package com.doradance.app.home;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.doradance.R;
import com.doradance.common.web.CommonWebviewFragment;
import com.pachong.android.baseuicomponent.activity.BaseActivity;

public class BannerDetilActivity extends BaseActivity {

    private CommonWebviewFragment mWebviewFragment;
    private String link;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        link = getIntent().getStringExtra("link");
        initToolsBar();
        String mUrl =link;
        mWebviewFragment = CommonWebviewFragment.newInstance(mUrl);
        getSupportFragmentManager().beginTransaction().add(R.id.fl_banner_detail, mWebviewFragment).commit();
    }

    private void initToolsBar() {
        setTitle("详情");
        getCustomToolbar().addLeftImageButton(R.mipmap.back, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    public static void start(Activity activity,String link){
        Intent intent = new Intent(activity, BannerDetilActivity.class);
        intent.putExtra("link",link);
        activity.startActivity(intent);
    }
    @Override
    public View createDataView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.activity_banner_detil,null);
    }
}
